<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 投票的反馈结果
 */
class VoteResult extends Model
{
    use SoftDeletes;

    protected $fillable = ['survey_id', 'participant_id', 'title_id'];

    /**
     * 获取所有已经反馈结果的参与者 $participant_id
     *
     * @return  array   一维数组
     */
    public static function getParticipartIds()
    {
        return self::groupBy('participant_id')->pluck('participant_id')->toArray();
    }
}